package bbkj.org.cn.config;

import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@DubboComponentScan("bbkj.org.cn.imple")
public class DubboConfig {

	@Bean
	public ApplicationConfig buildApplicationConfig() {
		ApplicationConfig bean = new ApplicationConfig();
		bean.setName("provider");
		return bean;
	}
	@Bean
	public RegistryConfig buildRegistryConfig() {
		RegistryConfig bean = new RegistryConfig();
		bean.setProtocol("zookeeper");
		bean.setAddress("127.0.0.1");
		bean.setTimeout(10000);
		bean.setPort(2181);
		bean.setRegister(true);
		bean.setCheck(false);
		return bean;
	}
//	@Bean
//	public ProtocolConfig buildProtocolConfig() {
//		ProtocolConfig bean = new ProtocolConfig();
//		bean.set
//		return bean;
//	}
}
